import request from '@/config/axios'

// 套系类别 VO
export interface OrderPackageTypeVO {
  id: number // 主键
  name: string // 类别名称
  orderType: number // 所属订单类别
  sort: number // 排序
}

// 套系类别 API
export const OrderPackageTypeApi = {
  // 查询套系类别分页
  getOrderPackageTypePage: async (params: any) => {
    return await request.get({ url: `/studio/order-package-type/page`, params })
  },

  // 查询套系类别详情
  getOrderPackageType: async (id: number) => {
    return await request.get({ url: `/studio/order-package-type/get?id=` + id })
  },

  // 新增套系类别
  createOrderPackageType: async (data: OrderPackageTypeVO) => {
    return await request.post({ url: `/studio/order-package-type/create`, data })
  },

  // 修改套系类别
  updateOrderPackageType: async (data: OrderPackageTypeVO) => {
    return await request.put({ url: `/studio/order-package-type/update`, data })
  },

  // 删除套系类别
  deleteOrderPackageType: async (id: number) => {
    return await request.delete({ url: `/studio/order-package-type/delete?id=` + id })
  },

  // 导出套系类别 Excel
  exportOrderPackageType: async (params) => {
    return await request.download({ url: `/studio/order-package-type/export-excel`, params })
  },

  // 获取套系类别简易集合 下拉框使用
  getOrderPackageTypeSimpleList: async () => {
    return await request.get({ url: `/studio/order-package-type/simple-list` })
  },
}
